function response(data) {
  var viewer = data.get("viewer_profile").getData();
  var owner = data.get("owner").getData();
  
  var img = owner.getField(opensocial.Person.Field.THUMBNAIL_URL);
 	 var fullPic = img.replace(/small/g, "tiny");
	 
  var OwnName = owner.getDisplayName();
  var cName = viewer.getDisplayName();
  var info2 = owner.getField(opensocial.Person.Field.ABOUT_ME);
  var myUrl= owner.getField(opensocial.Person.Field.PROFILE_URL);


		var profile_url = owner.getField(opensocial.Person.Field.PROFILE_URL);
		var regex = /uid=([^&#]+)/;
		var result = profile_url.match(regex);
  		  if (result.length == 2) {
   			   var uid = result[1];
    			  /* uid now contains the viewer's orkut UID */
    			} else {
     			 /* there was a problem getting the UID */
   			 }
  
  
  
  
  

           document.getElementById("InfoView").innerHTML=''
		   +'<input id="UserG" value="'+cName+'">'
		   +'<br>'
		   +'<input id="UserO" value="'+OwnName+'">'
		   +'<br>'
		   +'<input id="UserPic" value="'+img+'">'
		   +'<br>'
		   +'<input id="UserUrl" value="'+myUrl+'">'
		   +'<br>'
		   +'<input id="UserViewId" value="'+uid+'">'
		   +'<br>'
		   +'<input id="UserInfo" value="'+info2+'">'
		   +'<br>';
		   
		   document.getElementById("minpic").innerHTML='<img src="'+fullPic+'" class="DispPic">'
		   document.getElementById("UsrName").innerHTML=' '+OwnName+' '
		   
		   $.getScript(projurl + '/js/Medals.js');
};


function request() {
  var req = opensocial.newDataRequest();

  var params = {};
  params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [
	opensocial.Name.Field.GIVEN_NAME,
	opensocial.Person.Field.THUMBNAIL_URL,
	opensocial.Person.Field.ABOUT_ME,
	opensocial.Person.Field.PROFILE_URL
  ];

  req.add(req.newFetchPersonRequest("VIEWER", params), "viewer_profile");
  req.add(req.newFetchPersonRequest("OWNER", params), "owner");
  req.send(response);
};
request();

$.getScript(projurl + '/js/Base.js');